package com.up.blog.controller;

import com.alibaba.fastjson.JSON;
import com.up.blog.domain.Admininfobean;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
@Controller
public class AdminController {
    @RequestMapping(value = "/getadmin", produces = {"application/json;charset=UTF-8"})
    @ResponseBody
    public String findUserById(HttpServletRequest req, HttpServletResponse resp) {
        String rname= (String) req.getSession().getAttribute("rname");
        String headimg= (String) req.getSession().getAttribute("headimg");
        Admininfobean admininfobean=new Admininfobean();
        admininfobean.setAname(rname);
        admininfobean.setHeadimg(headimg);
        String ret= JSON.toJSONString(admininfobean);
        return ret;
    }
}
